import 'dart:convert';

abstract class WechatReq {
  const WechatReq();

  Map<String, dynamic> toJson();

  @override
  String toString() => const JsonEncoder.withIndent('  ').convert(toJson());
}


class WechatLaunchFromWXReq extends WechatReq {
  const WechatLaunchFromWXReq({
    this.messageAction,
    this.messageExt,
    required this.lang,
    required this.country,
  });

  factory WechatLaunchFromWXReq.fromJson(Map<String, dynamic> json) {
    return WechatLaunchFromWXReq(
      messageAction: json['messageAction'] as String?,
      messageExt: json['messageExt'] as String?,
      lang: json['lang'] as String,
      country: json['country'] as String,
    );
  }

  final String? messageAction;
  final String? messageExt;
  final String lang;
  final String country;

  @override
  Map<String, dynamic> toJson() {
    return {
      'messageAction': messageAction,
      'messageExt': messageExt,
      'lang': lang,
      'country': country,
    };
  }
}


class WechatShowMessageFromWXReq extends WechatReq {
  const WechatShowMessageFromWXReq({
    this.messageAction,
    this.messageExt,
    required this.lang,
    required this.country,
  });

  factory WechatShowMessageFromWXReq.fromJson(Map<String, dynamic> json) {
    return WechatShowMessageFromWXReq(
      messageAction: json['messageAction'] as String?,
      messageExt: json['messageExt'] as String?,
      lang: json['lang'] as String,
      country: json['country'] as String,
    );
  }

  final String? messageAction;
  final String? messageExt;
  final String lang;
  final String country;

  @override
  Map<String, dynamic> toJson() {
    return {
      'messageAction': messageAction,
      'messageExt': messageExt,
      'lang': lang,
      'country': country,
    };
  }
}




